<template>
    <div class="password-login">
        <group>
            <x-input title="输入手机号" type="tel" is-type="china-mobile" v-model="phone"></x-input>
            <x-input title="输入密码" type="password" v-model="password"></x-input>
            <xButton @click.native="login()">登陆</xButton>
        </group>
    </div>
</template>

<script>
    import {XButton, Group ,XInput} from 'vux'

    export default {
        name: 'password-login',
        data() {
                return {
                    phone: "",
                    password: "",
                    img_code: ""
            }
        },
        components: {
            XButton,
            Group,
            XInput
        },
        methods: {
            login(){
                alert("1");
                //无法跨域
                this.$http.post('http://test.mdy360.cn/loginForeground/userLogin', {
                    "phone": this.phone, "password": this.password
                }).then(({data}) => {
                    console.log(data)
                });
            }
        },
        mounted() {
        }
    }
</script>
<style lang="less" scoped>
    @import '../common/css/home.less';
</style>
